<template>
  <div class="logo-container">
    <img src="/src/assets/logo.png" />
    <div class="title" :style="{ color: color }">{{ title }}</div>
  </div>
</template>

<script lang="ts" setup>
/* 接收外部参数 */
interface PropsType {
  title: string;
  color?: string;
}
withDefaults(defineProps<PropsType>(), {
  title: '系统管理',
  color: '#fff',
});
</script>

<style scoped lang="less">
.logo-container {
  display: flex;
  align-items: center;
  padding: 20px 16px;
  height: 64px;
  box-sizing: border-box;
  & > img {
    display: block;
    width: 40px;
    line-height: 0;
    margin-left: 3px;
  }
  .title {
    margin-left: 8px;
    width: 100%;
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: all 0.1s;
    &.active {
      margin-left: 0;
      opacity: 0;
      width: 0;
    }
  }
}
</style>
